<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h2 id="num">0</h2>
    <button class="plus">+1</button>
    <button class="reduce">-1</button>
</body>
<script>
    let num = 0;
    var numBox = document.querySelector("#num");
    document.querySelector('.plus').addEventListener('click',function(){
        num++;
        numBox.innerHTML=num
    })
    document.querySelector('.reduce').addEventListener('click',function(){
        num--;
        numBox.innerHTML=num
    })
</script>
</html>